package cn.zc.service.impl;

import cn.zc.entity.LoginLogVo;
import cn.zc.entity.User;
import cn.zc.mapper.StudentMapper;
import cn.zc.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public void resetkey(String id) {
        studentMapper.resetkey(id);
    }

    @Override
    public void deleteStudentCourse(String id) {
        studentMapper.deleteStudentCourse(id);
    }

    @Override
    public User getStudentByStudentId(String id) {
        return studentMapper.getStudentByStudentId(id);
    }

    @Override
    public void addStudent(User user) {
        studentMapper.addStudent(user);
    }

    @Override
    public List<User> getStudentList(int page, int pageSize) {
        return studentMapper.getStudentList((page-1)*pageSize,pageSize);
    }

    @Override
    public List<LoginLogVo> getLoginLog(int page,int pageSize) {
        page=(page-1)*pageSize;
        return studentMapper.getLoginLog(page,pageSize);
    }

    @Override
    public int getLoginLogNum() {
        return studentMapper.getLoginLogNum();
    }

    @Override
    public int getStudentNum() {
        int studentNum = studentMapper.getStudentNum();
        return studentNum;
    }
}
